/**
 *  @description Vuex Modules Method
 */

import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const moduleFiles = require.context('./modules', false, /\.js$/)

const modules = {}

moduleFiles.keys().forEach(key => {
    const filename = key.replace(/(\.\/|\.js)/g, '')

    modules[filename] = moduleFiles(key).default
})
const store = new Vuex.Store({
    modules,
})

export default store
